package com.ccys.app.feignClient.fallback;

import com.ccys.app.feignClient.EmailFeignClient;
import com.ccys.db.dto.discount.MatchingPremiumCouponsDto;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @program: WhiteCoat
 * @description: 邮件相关远程调用的兜底类
 * @author: ZhangJingCan
 * @create: 2024-02-04 15:40
 **/

@Component
@Slf4j
public class EmailFallback implements FallbackFactory<EmailFeignClient> {


    @Override
    public EmailFeignClient create(Throwable throwable) {
        return new EmailFeignClient() {

            @Override
            public void queryAvailablePremiumCouponsByEmail(MatchingPremiumCouponsDto dto) {
                log.error("调用远程匹配优惠卷并发送邮件接口失败！");
            }
        };
    }
}
